#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include <stdbool.h>
int fun1(int num)
{
    int a = num % 10;
    return a;
}
int fun2(int i)
{
    int counts = 1;
    for (int a = 0; a < i; a++)
    {
        counts = counts * 10;
    }
    return counts;
}
int isSameAfterReversals(int num)
{
    int count = 1;
    int m = num;
    for (int i = 0; i < 10; i++)
    {
        if (m / 10 > 9)
        {
            count++;
            m = m / 10;
        }
        else
            break;
    }
    int nums = 0;
    int a = count + 1;
    for (int i = 0; i < a; i++)
    {
        nums += fun1(num) * fun2(count);
        count--;
        num = num / 10;
    }
    return nums;
}
int main()
{
    int num = 0;
    scanf("%d", &num);
    printf("%d", isSameAfterReversals(num));
    return 0;
}